package com.slg.android.listenbook.moudle;

/**
 * Created by Thinkpad on 2015/3/24.
 */
public class RecommendBook implements Comparable {
    private String announcer;// "神秘kook,
    private String author;
    private String commentCount;// 185,
    private String commentMean;
    private String cover;
    private String downPrice;// 0,
    private String hot;// 505,
    private String id;// 20093,
    private String lastUpdateTime;

    public String getAnnouncer() {
        return announcer;
    }

    public void setAnnouncer(String announcer) {
        this.announcer = announcer;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(String commentCount) {
        this.commentCount = commentCount;
    }

    public String getCommentMean() {
        return commentMean;
    }

    public void setCommentMean(String commentMean) {
        this.commentMean = commentMean;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getDownPrice() {
        return downPrice;
    }

    public void setDownPrice(String downPrice) {
        this.downPrice = downPrice;
    }

    public String getHot() {
        return hot;
    }

    public void setHot(String hot) {
        this.hot = hot;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(String lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public String getListenPrice() {
        return listenPrice;
    }

    public void setListenPrice(String listenPrice) {
        this.listenPrice = listenPrice;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSections() {
        return sections;
    }

    public void setSections(String sections) {
        this.sections = sections;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    private String listenPrice;// 0,
    private String name;
    private String sections;// 66,
    private String sort;// 0,
    private String state;// 1,
    private String typeId;// 11,
    private String typeName;// null

    @Override
    public String toString() {
        return "RecommendBook{" +
                "announcer='" + announcer + '\'' +
                ", author='" + author + '\'' +
                ", commentCount='" + commentCount + '\'' +
                ", commentMean='" + commentMean + '\'' +
                ", cover='" + cover + '\'' +
                ", downPrice='" + downPrice + '\'' +
                ", hot='" + hot + '\'' +
                ", id='" + id + '\'' +
                ", lastUpdateTime='" + lastUpdateTime + '\'' +
                ", listenPrice='" + listenPrice + '\'' +
                ", name='" + name + '\'' +
                ", sections='" + sections + '\'' +
                ", sort='" + sort + '\'' +
                ", state='" + state + '\'' +
                ", typeId='" + typeId + '\'' +
                ", typeName='" + typeName + '\'' +
                '}';
    }

    @Override
    public int compareTo(Object another) {
        if (another instanceof RecommendBook) {
            RecommendBook obook = (RecommendBook) another;
            int ohot = Integer.parseInt(obook.getHot());
            int thishot = Integer.parseInt(hot);
            if (thishot > ohot) {
                return 1;
            } else {
                return -1;
            }
        }
        return -1;
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof RecommendBook) {
            RecommendBook obook = (RecommendBook) o;
            String oid = obook.getId();
            if (oid.equals(this.id)) {
                return true;
            }
        }
        return false;
    }
}
